package miage.rest.model;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import java.io.Serializable;
import java.sql.Date;
import java.util.List;
import miage.rest.xml.xstream.converter.annotations.HrefVariable;

/**
 * PPD Rest
 * @author Schwartz Michaël
 */
@XStreamAlias("candidat")
public class Candidat implements Serializable {
	private static final long serialVersionUID = 1L;

	@XStreamAlias("id")
	@XStreamAsAttribute
	@HrefVariable
	private Integer idCandidat;
	
	private String nom;
	
	private String prenom;

	private String tel1;

	private String tel2;
	
	private String email;
	
	private Date dateNaissance;

	private String lieuNaissance;

	private String nomMarital;
	
	private String adresse;
	
	private String codePostal;
	
	private String ville;
	
	private String urlPhoto;
	
	private String sexe;

	@XStreamOmitField
	private String password;

	@XStreamOmitField
	private Integer fauxIdCandidat;
	
	private String noEtudiant;

	private String idLdap;

	private String idNationalite;

	private String idBlog;

	private List<Candidature> candidatures;
	

	public Candidat() {
	}

	public Candidat(Integer idCandidat) {
		this.idCandidat = idCandidat;
	}

	public Candidat(Integer idCandidat, String nom, String prenom, String email, String adresse, String codePostal, String ville) {
		this.idCandidat = idCandidat;
		this.nom = nom;
		this.prenom = prenom;
		this.email = email;
		this.adresse = adresse;
		this.codePostal = codePostal;
		this.ville = ville;
	}

	public Integer getIdCandidat() {
		return idCandidat;
	}

	public void setIdCandidat(Integer idCandidat) {
		this.idCandidat = idCandidat;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getPrenom() {
		return prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	public String getTel1() {
		return tel1;
	}

	public void setTel1(String tel1) {
		this.tel1 = tel1;
	}

	public String getTel2() {
		return tel2;
	}

	public void setTel2(String tel2) {
		this.tel2 = tel2;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getDateNaissance() {
		return dateNaissance;
	}

	public void setDateNaissance(Date dateNaissance) {
		this.dateNaissance = dateNaissance;
	}

	public String getLieuNaissance() {
		return lieuNaissance;
	}

	public void setLieuNaissance(String lieuNaissance) {
		this.lieuNaissance = lieuNaissance;
	}

	public String getNomMarital() {
		return nomMarital;
	}

	public void setNomMarital(String nomMarital) {
		this.nomMarital = nomMarital;
	}

	public String getAdresse() {
		return adresse;
	}

	public void setAdresse(String adresse) {
		this.adresse = adresse;
	}

	public String getCodePostal() {
		return codePostal;
	}

	public void setCodePostal(String codePostal) {
		this.codePostal = codePostal;
	}

	public String getVille() {
		return ville;
	}

	public void setVille(String ville) {
		this.ville = ville;
	}

	public String getIdNationalite() {
		return idNationalite;
	}

	public void setIdNationalite(String idNationalite) {
		this.idNationalite = idNationalite;
	}

	public String getIdBlog() {
		return idBlog;
	}

	public void setIdBlog(String idBlog) {
		this.idBlog = idBlog;
	}

	public String getUrlPhoto() {
		return urlPhoto;
	}

	public void setUrlPhoto(String urlPhoto) {
		this.urlPhoto = urlPhoto;
	}

	public String getIdLdap() {
		return idLdap;
	}

	public void setIdLdap(String idLdap) {
		this.idLdap = idLdap;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSexe() {
		return sexe;
	}

	public void setSexe(String sexe) {
		this.sexe = sexe;
	}

	public Integer getFauxIdCandidat() {
		return fauxIdCandidat;
	}

	public void setFauxIdCandidat(Integer fauxIdCandidat) {
		this.fauxIdCandidat = fauxIdCandidat;
	}

	public String getNoEtudiant() {
		return noEtudiant;
	}

	public void setNoEtudiant(String noEtudiant) {
		this.noEtudiant = noEtudiant;
	}

	public List<Candidature> getCandidatures() {
		return candidatures;
	}

	public void setCandidatures(List<Candidature> candidatures) {
		this.candidatures = candidatures;
	}


   

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (idCandidat != null ? idCandidat.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are not set
		if (!(object instanceof Candidat)) {
			return false;
		}
		Candidat other = (Candidat) object;
		if ((this.idCandidat == null && other.idCandidat != null) || (this.idCandidat != null && !this.idCandidat.equals(other.idCandidat))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "miage.rest.Candidat[idCandidat=" + idCandidat + "]";
	}

}
